package com.weayer.controller;

import com.weayer.dto.ResponseResult;
import com.weayer.request.ForecastPriceDTO;
import com.weayer.service.DirectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: Service服务 - 地图 - 地图Controller
 * @author: Weayer
 **/
@RestController
@RequestMapping("/direction")
public class DirectionController {
    @Autowired
    DirectionService directionService;

    @GetMapping("/driving")
    public ResponseResult driving(@RequestBody ForecastPriceDTO forecastPriceDTO){
        String depLongitude = forecastPriceDTO.getDepLongitude();
        String depLatitude = forecastPriceDTO.getDepLatitude();
        String desLongitude = forecastPriceDTO.getDesLongitude();
        String desLatitude = forecastPriceDTO.getDesLatitude();
        return directionService.driving(depLongitude, depLatitude, desLongitude, desLatitude);
    }
}
